package com.atguigu.security.custom;

public class LoginUserInfoHelper {
    private static ThreadLocal<Long> userId = new ThreadLocal<>();
    private static ThreadLocal<String> username = new ThreadLocal<>();

    public static void setUserId(Long _userId){
        userId.set(_userId);
    }

    public static Long getUserId(){
        return userId.get();
    }

    public static void removeUserId(){
        userId.remove();
    }

    public static void setUsername(String _username){
        username.set(_username);
    }

    public static String getUsername(){
        return username.get();
    }

    public static void removeUsername(){
        username.remove();
    }
}
